Personal tools

Lua/Shared/table/find

From JC2-MP Documentation

< Lua‎ | Shared
Jump to: navigation, search

Returns    number or string
Prototype    table.find(table table, object object)
Description    Returns the index of the first found object in table


Examples

local tbl = {}
tbl["someindex"] = 123
tbl[54] = "test"
tbl["index2"] = "needle"
 
print(table.find(tbl, "needle"))
-->index2